Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix siteLanguage("locale") TypoScript condition example #1449

Merged
merged 2 commits into from
Jan 4, 2025

Conversation

cundd
Copy link
Contributor

@cundd cundd commented Nov 27, 2024

The current example for the siteLanguage condition does not seem to be working. If I understand the code correctly, the locale string will be normalized to use dashes (e.g. fr-CH) as separator instead of an underscore (fr_CH) (see Locale.php.

The output of "locale" in <f:debug>{siteLanguage}</f:debug> is also a bit misleading as it uses the posixFormatted version instead of the one used in the TypoScript condition.

Please check this proposed change carefully, as I may not understand the whole picture and/or some things depend on the actual hosting environment.

Successor of PR #1436

@linawolf
Copy link
Member

Tests should run after rebasing, failures where not related to this PR

@cundd
Copy link
Contributor Author

cundd commented Nov 28, 2024

I synced the changes from upstream to my fork in Github.

@froemken
Copy link
Contributor

froemken commented Jan 4, 2025

Hello @cundd

I have tested that behavior. In TYPO3 core I found a Charset normalizer which converts all underscores to dashes. Thank you for your patch. I have just merged it.

Stefan

@froemken froemken merged commit aafbf5f into TYPO3-Documentation:main Jan 4, 2025
4 checks passed
Copy link
Contributor

github-actions bot commented Jan 4, 2025

The backport to 13.4 failed:

The process '/usr/bin/git' failed with exit code 128
stderr
error: commit 4dfbc334b71bfcc5fa90f5ea014cad08cb23a21d is a merge but no -m option was given.
fatal: cherry-pick failed

stdout
Auto-merging Documentation/Conditions/Index.rst
[backport-1449-to-13.4 81e6edc8] [BUGFIX] Fix `siteLanguage("locale")` TypoScript condition example
 Author: Daniel Corn <[email protected]>
 Date: Wed Nov 27 11:19:08 2024 +0100
 1 file changed, 3 insertions(+), 3 deletions(-)

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-13.4 13.4
# Navigate to the new working tree
cd .worktrees/backport-13.4
# Create a new branch
git switch --create backport-1449-to-13.4
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 9f106d7d3f357d646d26891c97834cb174178b10,4dfbc334b71bfcc5fa90f5ea014cad08cb23a21d
# Push it to GitHub
git push --set-upstream origin backport-1449-to-13.4
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-13.4

Then, create a pull request where the base branch is 13.4 and the compare/head branch is backport-1449-to-13.4.

froemken added a commit that referenced this pull request Jan 4, 2025
@froemken froemken added backport-done Changes have been backported to other branches already and removed backport failed labels Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 13.4 backport-done Changes have been backported to other branches already
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants